// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: 'cytfadmini-1gali3r244372a1f' 
}) 

// 云函数入口函数
// 获取已知fileid的图片文件临时文件路径
exports.main = async (event, context) => {
  var imgsrc = []   
  if(Array.isArray(event.img)){
    imgsrc = event.img
  }else{
    imgsrc.push(event.img)
  }
  const result = await cloud.getTempFileURL({
    fileList: imgsrc,
  })
  return result.fileList
}
